package com.xxh.dasongapp.security.utils;



import com.alibaba.fastjson.JSONObject;
import com.xxh.dasongapp.common.Result;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ResponseUtil {
    public static void renderString(HttpServletResponse response, Result result){
        response.setStatus(200);
        response.setContentType("application/json");
        response.setCharacterEncoding("utf-8");
        try {
            response.getWriter().print(JSONObject.toJSON(result));
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
